package test.com.sms.selenium.singlepoint.util;

import org.openqa.selenium.By;

import test.com.sms.selenium.framework.SeleniumPageUtil;
import test.com.sms.selenium.util.SeleniumUtil;

public class SpAssetsReportPageUtil extends SeleniumPageUtil {

	public  final static By SAR_SPAN_RESULT = By.id("ctl44_Report_ReportOutput");
	
	public static void enterAssetsReoprtPage(){
		SeleniumUtil.waitPageToLoad(SpHomePageUtil.getMainMenuAssets());
		SeleniumUtil.click(SpHomePageUtil.getMainMenuAssets());
		SeleniumUtil.waitPageToLoad(SpHomePageUtil.getAssetsReport());
		SeleniumUtil.click(SpHomePageUtil.getAssetsReport());
		waitForAssetsReportPageToLoad();
	}
	public static void waitForAssetsReportPageToLoad(){
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SeleniumUtil.selectDefaultContent();
		SeleniumUtil.waitForFixedMilliseconds(1000);
		SeleniumUtil.selectFrame(SpHomePageUtil.HOME_FRAME_CONTENT_NAME);
		SeleniumUtil.waitOnElements(new By[]{SAR_SPAN_RESULT});
		SeleniumUtil.isDisplayed(SeleniumUtil.getCachedElement(SAR_SPAN_RESULT));
	}
}
